package com.cxf.windex.base.rest;

import com.cxf.windex.entity.CxfPlatform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: drp
 * @description: API接口
 * @author: chenxf
 * @create: 2018-05-23 13:48
 **/
public class BaseApi {
    protected CxfPlatform cxfPlatform;
    protected Map<String,String> resultMap=new HashMap<String,String>(4);
    public static final Logger logger = LoggerFactory.getLogger(BaseApi.class);


    /**
     * 检验token
     * @param token
     * @return
     */
    protected boolean checkToken(String token){
        return true;
    }

    /**
     * 返回结果信息
     *
     * @param code 0成功 -1失败
     * @param message 结算信息
     */
    public Map<String, String> resultMap(String code, String message) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("code", code);
        map.put("msg", message);
        return map;
    }
}
